#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;


const int N = 1<<19;

int trie[N * 22][2], tcnt;
int root[N];
ll h[N * 22];

int n, a[N], cp[N];

unsigned w[N];


int tr[N * 2];

inline int query(int l, int r) {
    l = N + l - 1, r = N + r + 1;
    int ret = 0;
    while(l / 2 != r / 2) {
        if((l & 1) ^ 1) ret = max(ret, tr[l ^ 1]);
        if((r & 1) ^ 0) ret = max(ret, tr[r ^ 1]);
        l /= 2;
        r /= 2;
    }
    return ret;
}

int main() {
    unsigned long long seed = time(NULL);
    scanf("%d", &n);
    for(int i = 1; i <= n; i ++) {
        scanf("%d", a + i);
        seed = (seed << 33) + (seed << 22) + (seed << 6) + seed + a[i];
    }
    memcpy(cp, a, sizeof cp);
    sort(cp + 1, cp + n + 1);
    mt19937 rnd(seed);
    for(int i = 1; i <= n; i ++) {
        w[i] = rnd();
    }
    for(int i = 1; i <= n; i ++) {
        a[i] = tr[N + i] = lower_bound(cp + 1, cp + n + 1, a[i]) - cp;
        for(int j = 1<<19, u = root[i] = ++ tcnt, v = root[i - 1]; j; j>>=1) {
            int x = (j & a[i]) ? 1 : 0;
            trie[u][x ^ 1] = trie[v][x ^ 1];
            u = trie[u][x] = ++ tcnt;
            v = trie[v][x];
            h[u] = h[v] + w[a[i]];
        }
    }
    for(int i = N - 1; i; i --)
        tr[i] = max(tr[i * 2], tr[i * 2 + 1]);
    
    int q;
    scanf("%d", &q);
    for(int i = 1, l, r, L, R, j, u, v, U, V; i <= q; i ++) {
        scanf("%d%d%d%d", &l, &r, &L, &R);
        int ans = 0;
        for(j = 1<<19, u = root[r], v = root[l - 1], U = root[R], V = root[L - 1]; j; j>>=1) {
            int x = (h[trie[u][0]] - h[trie[v][0]] == h[trie[U][0]] - h[trie[V][0]]);
            u = trie[u][x];
            v = trie[v][x];
            U = trie[U][x];
            V = trie[V][x];
            ans += x * j;
        }
        int maxl = query(l, r), maxR = query(L, R);
        if(h[u] - h[v] == h[U] - h[V]) puts("=");
        else if((h[u] - h[v] < h[U] - h[V])) {
            if(maxl <= ans) puts("<");
            else puts(">");
        }
        else {
            if(maxR <= ans) puts(">");
            else puts("<");
        }
    }
}